#include <bits/stdc++.h>
using namespace std;

bool find(vector<long> s, int a) {
	for (long num : s) {
		if (a == num) {
			return false;
		}
	}
	return true;
}

int main() {
	int n, t;
	cin >> n;
	for (int i = 0; i < n; ++i) {
		vector<long> s;
		cin >> t;
		for (int j = 0; j < t; ++j) {
			long a;
			cin >> a;
			if (find(s, a)) {
				s.push_back(a);
			}
		}
		cout << (long)pow(2, s.size()) << endl;

	}

	return 0;
}